<script lang="ts">
export default {
  name: "RepositoryProductFormHeader"
}
</script>

<template>
  <el-form ref="queryFormRef" :inline="true" :model="dataState.queryParams">
    <el-form-item prop="keyword">
      <el-input style="width: 500px" v-model="dataState.queryParams.keyWord" clearable placeholder="关键字" @keyup.enter="handleQuery"/>
    </el-form-item>

    <el-form-item>
      <el-button :icon="Search" type="primary" @click="handleQuery">过滤</el-button>
    </el-form-item>
  </el-form>
</template>

<script lang="ts" setup>
import {onMounted, reactive} from "vue";

import {Search} from '@element-plus/icons-vue';
import {RepoProductQueryParam} from "@/api/device/product/types";

const emit = defineEmits(['query']);// 定义组件的事件通知


// 数据状态：定义
let dataState = reactive({
  // 组件类型选项
  componentTypeOptions: [] as OptionType[],
  // 组件类型选项
  statusTypeOptions: [] as OptionType[],
  // 查询参数
  queryParams: {pageNum: 1, pageSize: 10} as RepoProductQueryParam,
});


function handleQuery() {
  emit('query', 'header', dataState.queryParams);
}

/**
 * 响应页面安装：页面的初始化工作
 */
onMounted(() => {
});

</script>
